package com.dqyt.app.controller;

import com.dqyt.app.service.AppManufacturerService;
import com.dqyt.khjc.bean.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class AppManufacturerController {

    @Autowired
    private AppManufacturerService appManufacturerService;

    /**
     * 查询制造厂商
     * @param request
     * @return
     */
    @RequestMapping(value = "/sample/getManufacturers", method = {RequestMethod.GET,RequestMethod.POST})
    public ResultMsg getManufacturers(HttpServletRequest request,long userId, String token){
        ResultMsg resultMsg = appManufacturerService.getManufacturers(request,userId,token);
        return resultMsg;
    }




    /**
     * 添加制造厂商
     * @param request
     * @return
     */
    @RequestMapping(value = "/sample/addManufacturer", method = {RequestMethod.GET,RequestMethod.POST})
    public ResultMsg addManufacturer(HttpServletRequest request,long userId, String token,String name,String address){
        ResultMsg resultMsg = appManufacturerService.addManufacturer(request,userId,token,name,address);
        return resultMsg;
    }

}
